<?php
/**
 * <b>RUBIK IT Solution & Development ltd.</b>
 *
 * PROJECT		: Rubik Ultimate Framework
 * @version 	: 1.1
 * COPYRIGHT    : 2008
 * ------------------------------------------------------
 * 
 * Created on	:  Jun 16, 2008
 * 
 */

// no direct access
defined ( '_FW_EXEC' ) or die ( 'Restricted access' );

/**
 * Class keeping list of resoucrces of a site
 *
 */
class SiteResourceList {
	
	/**
	 * List of site resource
	 *
	 * @var array
	 */
	var $_resourceList = array ();
	
	/**
	 * Add the SiteResource into this list
	 *
	 * @param SiteResource $siteResource
	 */
	function addResource($siteResource) {
		$this->_resourceList [] = $siteResource;
	}
	
	/**
	 * Check if the input Resource cover one of 
	 * an existing resource inside the list.
	 *
	 * @param SiteResource $siteResource
	 * @return boolean
	 */
	function checkInputCover($siteResource) {
		foreach ( $this->_resourceList as $resource ) {
			if ($siteResource->checkCover ( $resource )) {
				return true;
			}
		}
		return false;
	}
}
?>